package com.x.crm.http.response.login;

import com.x.crm.DocDesc;
import com.x.security.model.Resource;

import java.io.Serializable;
import java.util.List;

public class CrmResource implements Serializable {
    @DocDesc("资源id")
    private String resourceId;
    @DocDesc("资源的父节点id")
    private String resourceParentId;
    @DocDesc("资源的名称")
    private String resourceName;
    @DocDesc("资源的url")
    private String resourceUrl;
    @DocDesc("资源顺序号")
    private int resourceSeq;
    @DocDesc("资源图标url")
    private String resourceIcon;
    @DocDesc("资源类型")
    private int resourceType;
    @DocDesc("资源状态")
    private int resourceState;
    @DocDesc("应用id")
    private String applicationId;
    @DocDesc("资源的叶子节点列表，可多级递归")
    private List<CrmResource> resources;

    public CrmResource(Resource resource) {
        this.resourceId = resource.getResourceId();
        this.resourceParentId = resource.getResourceParentId();
        this.resourceName = resource.getResourceName();
        this.resourceUrl = resource.getResourceUrl();
        this.resourceSeq = resource.getResourceSeq();
        this.resourceId = resource.getResourceIcon();
        this.resourceType = resource.getResourceType();
        this.resourceState = resource.getResourceState();
        this.applicationId = resource.getApplicationId();
        this.resources = ConvertUtil.convertResourceList(resource.getResourceList());
    }

    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    public String getResourceParentId() {
        return resourceParentId;
    }

    public void setResourceParentId(String resourceParentId) {
        this.resourceParentId = resourceParentId;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getResourceUrl() {
        return resourceUrl;
    }

    public void setResourceUrl(String resourceUrl) {
        this.resourceUrl = resourceUrl;
    }

    public int getResourceSeq() {
        return resourceSeq;
    }

    public void setResourceSeq(int resourceSeq) {
        this.resourceSeq = resourceSeq;
    }

    public String getResourceIcon() {
        return resourceIcon;
    }

    public void setResourceIcon(String resourceIcon) {
        this.resourceIcon = resourceIcon;
    }

    public int getResourceType() {
        return resourceType;
    }

    public void setResourceType(int resourceType) {
        this.resourceType = resourceType;
    }

    public int getResourceState() {
        return resourceState;
    }

    public void setResourceState(int resourceState) {
        this.resourceState = resourceState;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public List<CrmResource> getResources() {
        return resources;
    }

    public void setResources(List<CrmResource> resources) {
        this.resources = resources;
    }
}
